package com.congwulin.wechat.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(url = "${trainApi.url}",name="train")
public interface WeChatTrainService {
    @RequestMapping(value="/otn/resources/js/framework/station_name.js",method = RequestMethod.GET)
    public String getStationInfo();

    @RequestMapping(value="/otn/leftTicket/query",method = RequestMethod.GET)
    public JSONObject getTicketInfo(@RequestParam("leftTicketDTO.train_date") String train_date,
                                    @RequestParam("leftTicketDTO.from_station") String from_station,
                                    @RequestParam("leftTicketDTO.to_station") String to_station,
                                    @RequestParam("purpose_codes") String purpose_codes);

    @RequestMapping(value="/otn/czxx/queryByTrainNo",method = RequestMethod.GET)
    public JSONObject getStationInfoByTrainNo(@RequestParam("train_no") String train_no,
                                          @RequestParam("from_station_telecode") String from_station_telecode,
                                          @RequestParam("to_station_telecode") String to_station_telecode,
                                          @RequestParam("depart_date") String depart_date);

    @RequestMapping(value="/otn/leftTicket/queryTicketPrice",method = RequestMethod.GET)
    public JSONObject getTicketPrice(@RequestParam("train_no") String train_no,
                                              @RequestParam("from_station_no") String from_station_no,
                                              @RequestParam("to_station_no") String to_station_no,
                                              @RequestParam("seat_types") String seat_types,
                                              @RequestParam("train_date") String train_date);
}
